import { getBrandInfo } from '@/utils/http.js'
export default {
	namespaced: true,
	state: {
		indexList: [],
		itemArr: [],
		brandTop: []
	},
	getters: {

	},
	mutations: {
		setBrand(state, brand) {
			const { indexList, itemArr, top } = brand
			indexList.unshift("热")
			itemArr.unshift(top)
			state.indexList = indexList
			state.itemArr = itemArr
			state.brandTop = top
		}
	},
	actions: {
		getBrand({ commit }) {
			getBrandInfo().then(res => {
				const { data } = res
				commit('setBrand', data)
			})
		},
	}
}